-- GENERATED SPELL FOR [Skeletal Guardian] --


function spell0_10390(pUnit, Event) --@Arcane Bolt,n/a--
pUnit:FullCastSpellOnTarget(37361,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_10390', 1000, 1)
end

function spell1_10390(pUnit, Event) --@Arcane Explosion,Self--
pUnit:FullCastSpellOnTarget(11975,pUnit)
pUnit:RegisterEvent('Sorts_10390', 1500, 1)
end

function spell2_10390(pUnit, Event) --@Cone of Cold,Self--
pUnit:FullCastSpellOnTarget(12557,pUnit)
pUnit:RegisterEvent('Sorts_10390', 8291, 1)
end

function spell3_10390(pUnit, Event) --@Demon Armor,Self--
pUnit:FullCastSpellOnTarget(13787,pUnit)
pUnit:RegisterEvent('Sorts_10390', 0, 1)
end

function spell4_10390(pUnit, Event) --@Frostbolt,n/a--
pUnit:FullCastSpellOnTarget(9672,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_10390', 7000, 1)
end

function spell5_10390(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(9613,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_10390', 3000, 1)
end

function Sorts_10390(pUnit, Event)
local choix_sorts_10390 = math.random(0, 5)
if choix_sorts_10390 == 0 then
pUnit:RegisterEvent('spell0_10390', 1, 1)
end
if choix_sorts_10390 == 1 then
pUnit:RegisterEvent('spell1_10390', 1, 1)
end
if choix_sorts_10390 == 2 then
pUnit:RegisterEvent('spell2_10390', 1, 1)
end
if choix_sorts_10390 == 3 then
pUnit:RegisterEvent('spell3_10390', 1, 1)
end
if choix_sorts_10390 == 4 then
pUnit:RegisterEvent('spell4_10390', 1, 1)
end
if choix_sorts_10390 == 5 then
pUnit:RegisterEvent('spell5_10390', 1, 1)
end
end

function mob10390_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_10390', math.random(1500, 3000), 1)
end

function mob10390_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob10390_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob10390_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(10390, 1, 'mob10390_Action')
RegisterUnitEvent(10390, 2, 'mob10390_Leave')
RegisterUnitEvent(10390, 3, 'mob10390_Kill')
RegisterUnitEvent(10390, 4, 'mob10390_Die')
